Timing of preventive action based on prediction model